/*
 * Copyright (C) 2021 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package cn.edu.tjnu.simplequery.domain.dto;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * 2021/11/6
 *
 * @author 王帅
 * @since 1.0
 */
@Data
public class RecordDTO {

    @NotNull
    @Pattern(regexp = "\\d{10}|\\d{6}")
    private String number;

    @NotNull
    @Pattern(regexp = "[\\u4e00-\\u9fa5]{2,10}")
    private String name;

    @NotNull
    @Pattern(regexp = "(\\d+)(:\\d+){0,14}")
    private String requiredData;

    @NotNull
    @Length(max = 255)
    private String reason;

    @NotNull
    @Pattern(regexp = "[0-9a-zA-Z]+")
    private String captcha;

}
